import React, { Component } from "react";
import TopBar from "../components/TopBar";
import BottomBar from "../components/BottomBar";

class Layout extends Component {
    constructor(props) {
        super(props);
        this.state = {  }
    }
    componentDidMount(){
        const {title= '商城'} = this.props;
        document.title = title
    }
    render() { 
        const {children, showTopBar, showBottomBar} = this.props
        return ( 
            <div>
                {/* <TopBar/> */}
                {showTopBar && <TopBar/>}
                {/* {this.props.children} */}
                {/* <h3>Layout</h3> */}
                {children.content}
                {children.txt}
                <button onClick={children.btnClick}>button</button>
                {/* <BottomBar/> */}
                {showBottomBar && <BottomBar/>}
            </div>
         );
    }
}
 
export default Layout;